Driving the gate of a main power switch in a switching power supply may have a great impact on power performance. Serious electromagnetic interference (EMI) may result because of relatively large di/dt and dv/dt of the main power switch if the driving capacity is too strong (e.g., the driving current is too large). Also, switching losses may increase because of slow switching speeds due to relatively large switching delays of the main power switch if the driving capacity is too weak (e.g., the driving current is too small).